package com.hll.javaweb.servlet.mvc.dao.impl;

import com.hll.javaweb.servlet.mvc.dao.StudentDao;
import com.hll.javaweb.servlet.mvc.pojo.Student;

import java.util.ArrayList;
import java.util.List;

/**
 * @author hll
 * @create 2022-05-10 17:36
 */
public class StudentDaoImpl implements StudentDao {
  private final int MAX_SIZE = 10;
  private List<Student> students = new ArrayList<>();

  @Override
  public List<Student> getStudents() {
    return students;
  }

  @Override
  public Boolean addStudent(Student student) {
    if (students.size() < 10) {
      students.add(student);
      return true;
    }
    return false;
  }
}
